package com.fh.mappers;

import com.fh.entity.po.Type;
import com.fh.entity.vo.KeyVo;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * 描述:
 * Author:袁亚强
 * Date:2021/11/2111:58
 */
@Mapper
public interface TypeMapper {


    @Select("select * from t_shop_type where isdel=0")
    List<Type> queryTypeData();

    @Update("update t_shop_type set isdel=1 where id=#{id}")
    void deleteTypeById(Integer id);

    @Insert("insert into t_shop_type (name,img,pid,isdel,createDate) value(#{name},#{img},#{pid},#{isdel},#{createDate})")
    void addTypeData(Type type);

    @Select("select * from t_shop_type where id=#{id}")
    Type queryById(Integer id);

    @Update("update t_shop_type set name=#{name},img=#{img}  where id=#{id}")
    void updateType(Type type);

    @Select("select * from t_shop_type where isdel=0")
    List<Type> query();
}
